<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form th:action="@{/book}" method="post">
    图书名称:<input type="text" name="name" >
    图书类别:<input type="text" name="category" >
    图书作者:<input type="text" name="author" >
    <input type="submit" value="查询">
</form>


<table border="1">
    <tr>
        <th>编号</th>
        <th>书名</th>
        <th>价格</th>
        <th>类目</th>
        <th>库存</th>
        <th>图片</th>
        <th>说明</th>
        <th>作者</th>
        <th>已售</th>
    </tr>
    <tr th:each="book:${page.records}">
        <td th:text="${book.id}"></td>
        <td th:text="${book.name}"></td>
        <td th:text="${book.price}"></td>
        <td th:text="${book.category}"></td>
        <td th:text="${book.pnum}"></td>
        <td th:text="${book.imgurl}"></td>
        <td th:text="${book.description}"></td>
        <td th:text="${book.author}"></td>
        <td th:text="${book.sales}"></td>
    </tr>
</table>

总的页数:<span th:text="${page.pages}"></span>
总的记录数:<span th:text="${page.total}"></span>
当前页:<span th:text="${page.current}"></span>


<span th:if="${page.current >1}">
    <a th:href="@{/book/page(pageNum=${page.current -1})}">上一页</a>
</span>
<span th:each="p:${#numbers.sequence(1,page.pages)}">
    <a th:href="@{/book/page(pageNum=${p})}" th:text="${p}"></a>
</span>

<span th:if="${page.current<page.pages}">
    <a th:href="@{/book/page(pageNum=${page.current +1})}">下一页</a>
</span>
</body>
</html>